<template>
  <!--载入动画-->
  <transition name='fade'>
    <div class="img-view"
         @click="bigImg">
      <!-- 遮罩层-->
      <div class="img-layer">
      </div>

      <img :src='imgSrc' />

    </div>
  </transition>
</template>
<script>
export default {
  props: ['imgSrc'],
  methods: {
    bigImg () {
      this.$emit('clickit')
    }
  }
}
</script>
 <style scoped>
/*动画*/
.fade-enter-active,
.fade-leave-active {
  transition: all 0.2s linear;
  transform: translate3d(0, 0, 0);
}
.fade-enter,
.fade-leave-active {
  transform: translate3d(100%, 0, 0);
}
/*bigImg*/
.img-view {
  position: fixed;
  z-index: 999;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

/*遮罩层*/
.img-view .img-layer {
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.7);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/*图片剧中显示*/
.img-view img {
  position: absolute;
  max-width: 100%;
  display: block;
  left: 0;
  right: 0;
  top: 0;
  margin: auto;
  z-index: 1000;
  /* vertical-align: middle; */
}
</style>





